﻿<Window x:Class="SsTool.Workflow.Windows.UpdateActivityWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="UpdateActivityWindow" Height="500" Width="800" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <TabControl Grid.Row="0" Margin="5">
            <TabItem>
                <TabItem.Header>
                    <StackPanel Orientation="Horizontal" Margin="1">
                        <Image Source="../../Resources/detail.png" Margin="0,0,3,0"/>
                        <TextBlock Text="基本信息"/>
                    </StackPanel>
                </TabItem.Header>
                <StackPanel Margin="5">
                    <Label Content="ID:" Name="label1" />
                    <TextBox Text="{Binding Id}" IsReadOnly="True" />
                    
                    <Label Content="Caption:"/>
                    <TextBox Text="{Binding Caption}"/>
                </StackPanel>
            </TabItem>
            <TabItem>
                <TabItem.Header>
                    <StackPanel Orientation="Horizontal" Margin="1">
                        <Image Source="../../Resources/setting.png" Margin="0,0,3,0"/>
                        <TextBlock Text="数据权限设置"/>
                    </StackPanel>
                </TabItem.Header>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5">
                        <Button Content="添加角色" Name="_ctlBtnAddRole" Click="_ctlBtnAdd4Visit_Click" />
                        <Button Content="删除角色" Name="_ctlBtnRemoveRole"/>
                        <Button Content="视图允许访问" Name="_ctlBtnAllowView" Click="_ctlBtnAllowView_Click" Margin="20,0,0,0"/>
                        <Button Content="视图允许修改" Name="_ctlBtnAllowUpdate" Click="_ctlBtnAllowUpdate_Click" />
                        <Button Content="视图允许删除" Name="_ctlBtnAllowDelete" Click="_ctlBtnAllowDelete_Click" />
                        <Button Content="字段在列表中显示" Name="_ctlBtnIsList" Click="_ctlBtnIsList_Click" Margin="20,0,0,0"/>
                        <Button Content="字段允许访问" Name="_ctlBtnAllowVisitField" Click="_ctlBtnAllowVisitField_Click" />
                        <Button Content="字段允许修改" Name="_ctlBtnAllowModifyField" Click="_ctlBtnAllowModifyField_Click" />
                    </StackPanel>
                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <DataGrid Grid.Column="0" Name="_ctlGridRights" ItemsSource="{Binding Rights}" AutoGenerateColumns="False" SelectionChanged="_ctlGridRights_SelectionChanged" CanUserAddRows="False">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="名称" Binding="{Binding Path=Role.Caption}" Width="*" IsReadOnly="True"/>
                                <DataGridTextColumn Header="Name" Binding="{Binding Path=Role.Name}" Width="*" IsReadOnly="True"/>
                                <DataGridCheckBoxColumn Header="允许访问" Binding="{Binding Path=IsAllowVisit, Mode=TwoWay}" Width="*"/>
                                <DataGridCheckBoxColumn Header="允许修改" Binding="{Binding Path=IsAllowModify, Mode=TwoWay}" Width="*"/>
                                <DataGridCheckBoxColumn Header="允许删除" Binding="{Binding Path=IsAllowRemove, Mode=TwoWay}" Width="*"/>
                            </DataGrid.Columns>
                        </DataGrid>
                        <DataGrid Grid.Column="1" Name="_ctlGridFieldRight" AutoGenerateColumns="False" Margin="5,0,0,0" CanUserAddRows="False">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Caption" Binding="{Binding Path=Property.Caption}" Width="*" IsReadOnly="True"/>
                                <DataGridTextColumn Header="Type" Binding="{Binding Path=Property.Type.Caption}" Width="*" IsReadOnly="True"/>
                                <DataGridCheckBoxColumn Header="在列表中显示" Binding="{Binding Path=IsList, Mode=TwoWay}" Width="*"/>
                                <DataGridCheckBoxColumn Header="允许访问" Binding="{Binding Path=IsAllowVisit, Mode=TwoWay}" Width="*"/>
                                <DataGridCheckBoxColumn Header="允许修改" Binding="{Binding Path=IsAllowModify, Mode=TwoWay}" Width="*"/>
                            </DataGrid.Columns>
                        </DataGrid>
                        <TextBlock Grid.Column="2" Width="100" Padding="3" Text="允许修改，不允许访问的字段一般设置为系统类型的字段" TextWrapping="Wrap" />
                    </Grid>
                </Grid>
            </TabItem>
        </TabControl>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <Button Name="button1" Click="button1_Click" Margin="5">
                <StackPanel Orientation="Horizontal" Margin="1">
                    <Image Source="../../Resources/accept.png" Margin="0,0,3,0"/>
                    <TextBlock Text="确定"/>
                </StackPanel>
            </Button>
            <Button Name="_ctlBtnCancel" Click="_ctlBtnCancel_Click" Margin="5">
                <StackPanel Orientation="Horizontal" Margin="1">
                    <Image Source="../../Resources/cancel.png" Margin="0,0,3,0"/>
                    <TextBlock Text="关闭"/>
                </StackPanel>
            </Button>
        </StackPanel>
    </Grid>
</Window>
